package com.uniview.dao;

import com.uniview.service.impl.ServiceOrdersServiceImpl;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Repository;

import com.uniview.base.BaseDao;
import com.uniview.entity.po.ServiceOrdersLogs;

import java.util.List;

@Repository
public class ServiceOrdersLogsDao extends BaseDao<ServiceOrdersLogs> {

    private Logger logger = Logger.getLogger(ServiceOrdersServiceImpl.class);

    /**
     * 获取日志
     */
    public List<ServiceOrdersLogs> findLogsByOrderId(Integer orderId) throws Exception{
        String sql = "SELECT * FROM sd_orders_logs WHERE orderId=" + orderId + " ORDER BY createTime DESC";
        logger.info("========获取工单处理日志" + sql);
        List<ServiceOrdersLogs> list = this.findBySql(sql);
        if (null != list && list.size()>0){
            return list;
        }
        return null;
    }
}
